This expression is then retained by the Pattern class before it is passed on to the Matcher class to check for matches in the context of a character sequence. Pattern先保存要使用的表达式,然后将其传递给Matcher类以便在字符序列的上下文中检查其匹配情况。
To match a Pattern against regions of an arbitrary CharSequence, you use the pattern instance to construct a Matcher object, passing the CharSequence as a parameter. 要将Pattern与CharSequence的区域匹配,要使用模式实例构建Matcher对象,将CharSequence作为参数传递给Matcher。
These two classes Pattern and Matcher are the whole pattern-matching library. 这两个类(Pattern与Matcher)就是整个模式匹配库。
To grasp how this works you first need to understand the access pattern of a Matcher to its CharSequence. 为了掌握这种方法,首先需要理解Matcher到其CharSequence的访问模式。